<template>
  <div class="inf">
    <!-- 面包屑导航 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>用户</el-breadcrumb-item>
      <el-breadcrumb-item>基本资料</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 表格组件 -->
    <el-table :data="infoList" style="width: 100%">
      <el-table-column :index="indexMethod" type="index" label="序号">
      </el-table-column>
      <el-table-column prop="title" label="姓名"> </el-table-column>
      <el-table-column prop="user.nickname" label="年龄"> </el-table-column>
      <el-table-column label="创建时间">
        <template v-slot="obj">
          <div class="time">{{ obj.row.create_date | date }}</div>
        </template>
      </el-table-column>
      <el-table-column label="地址">
        <template v-slot="obj">
          <!-- <img :src="methodURL(obj.row.cover[0].url)" alt /> -->
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template v-slot="obj">
          <el-button type="primary" @click="edit(obj.row.id)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <div class="pages">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageIndex"
        :page-sizes="[5, 10, 15, 20]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 资料
      infoList: [],
      pageIndex: 1,
      pageSize: 5,
      total: 1
    };
  },
  methods: {
    // 索引
    indexMethod(index) {
      return index + 1 + (this.pageIndex - 1) * this.pageSize;
    },
    // 改变当前页面条数触发
    handleSizeChange(val) {
      this.pageSize = val;
      //   this.getPostList();
    },
    // 改变当前页数会触发
    handleCurrentChange(val) {
      this.pageIndex = val;
      //   this.getPostList();
    }
  }
};
</script>

<style></style>
